1. Technical Field
The present invention relates generally to an improved data processing system and in particular to a method and apparatus for determining compatibility of different classes in a data processing system. Still more particularly, the present invention provides a method and apparatus for versioning and identfying compatibility between classes in a object oriented hierarchy.
2. Description of Related Art
With the rapid developments occurring in the software industry, a current version of a program may be current only for a short period of time with minor and major improvements occurring often. A xe2x80x9cversionxe2x80x9d is a particular issue or release of a computer program, module or class. A xe2x80x9cversion numberxe2x80x9d is a number assigned by a software developer to identify a particular program. at a particular stage, before and after public release. Successive releases of a program are assigned increasingly higher numbers, such as version 1, version 2, and version 3. Many improvements to software occur so rapidly that the distribution of these improvements are made through web sites on the Internet, rather than by mail or at a store.
Changes in individual components that interact with each other in a computer program also may occur. Sometimes different groups or companies may provide updates to different components. The changes to these components also may be distributed to users through various channels. With such distribution of components, managing compatibility between versions is a desirable feature in a system in which objects or components interact within other components, but in which not all of the objects or components are changed at the same time. With object oriented environments, a parent class of a child class may chance over time and the parent class may be supplied by a company different from that of the child class. The current version systems available do not take into account the fact that while a class may change over time that backwards compatibility to previous classes may be maintained.
Therefore, it would be desirable to have an improved method and apparatus for managing compatibility between different versions of interacting components, especially between child and parent classes.
The present invention provides a method and apparatus in a computer for comparing version information contained within class definitions to determine compatibility between classes in a hierarchy within an object oriented system.
Version information is collected from the class being instantiated and its parent class. This information includes current version, compatible versions, and the version requirements that the class defines for its parent class. The required version is used to determine compatibility with the parent class. The runtime system utilizes this collection of information from both class definitions, analyzes the version relationship and determines the course of action to take based on this analysis.